using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using buildingLib.security;
namespace _dmis.query
{
    public partial class HistoryQuery : _dmis.UIFormBase
    {
        public delegate void ShowInfoCallBack(object data);
        ShowInfoCallBack m_callback;
        public HistoryQuery(ShowInfoCallBack callback)
        {
            InitializeComponent();
            this.dgv_History.AutoGenerateColumns = false;
            m_callback = callback;
        }

        public void LoadHistory<T>(Guid pkey, int skey)where T:class,ILogItem
        {
            this.dgv_History.DataSource = OperateLogger.GetOperateList<T>(pkey, skey);
        }

        private void HistoryQuery_Load(object sender, EventArgs e)
        {

        }

        private void dgv_History_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex != -1 && e.ColumnIndex == 1)
            {
                if (m_callback != null)
                    m_callback(dgv_History.Rows[e.RowIndex].DataBoundItem);
            }
        }
    }
}

